<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title><spring:message code="template.import"/></title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#no").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('<spring:message code="common.subbmiting"/>');
                    timeVali($("#btnSubmit"));
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active">
			<a href="${ctx}/templet/eleTemplet/">
				<spring:message code="menu.template.Import"/>
			</a>
		</li>
	</ul>
	<form:form id="inputForm" modelAttribute="eleTemplet" action="${ctx}/templet/eleTemplet/import" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<div class="control-group">
			<label class="control-label"><spring:message code="template.name"/>:</label>
			<div class="controls">
				 <form:input id="name" path="name" htmlEscape="false" maxlength="255" class="input-small required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="template.file"/>:</label>
			<div class="controls">
				<form:hidden id="url" path="url" htmlEscape="false" maxlength="255" class="input-xlarge"/>
				<sys:ckfinder input="url" type="zips" uploadPath="/source/template/import" selectMultiple="false" langCode="${langCode}"/>
			</div>
		</div>
	
		<div class="form-actions">
			<shiro:hasPermission name="templet:eleTemplet:edit">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="<spring:message code='common.import'/>"/>&nbsp;
			</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="<spring:message code='common.back'/>" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>